import { defHttp } from '/@/utils/http/axios';
import { IPostCustomUpdateRaw } from '/@/types/system/auxiliary/custom/update';
import { IGetCustomDropdownResponse } from '/@/types/system/auxiliary/custom/dropdown';
import {
  IPostCustomListRequest,
  IPostCustomListResponse,
} from '/@/types/system/auxiliary/custom/list';
import { IGetRawCustomDetailsResponse } from '/@/types/system/auxiliary/custom/details';
import { IPostCustomAddRequest } from '/@/types/system/auxiliary/custom/add';

/**
 * 修改客户类别
 */
export const apiPostCustomUpdatePath = (id: string | number, params: IPostCustomUpdateRaw) =>
  defHttp.post({ url: `/system/auxiliary/custom/update/${id}`, params });
/**
 * 删除客户类别
 */
export const apiPostCustomDeletePath = (id: string | number) =>
  defHttp.post({ url: `/system/auxiliary/custom/delete/${id}` });
/**
 * 客户类别下拉列表
 */
export const apiGetCustomDropdown = () =>
  defHttp.get<IGetCustomDropdownResponse>({ url: `/system/auxiliary/custom/dropdown` });
/**
 * 客户类别列表
 */
export const apiPostCustomList = (params: IPostCustomListRequest) =>
  defHttp.post<IPostCustomListResponse>({ url: `/system/auxiliary/custom/list`, params });
/**
 * 客户类别详情
 */
export const apiGetCustomDetailsPath = (id: string | number) =>
  defHttp.get<IGetRawCustomDetailsResponse>({ url: `/system/auxiliary/custom/details/${id}` });
/**
 * 新增客户类别
 */
export const apiPostCustomAdd = (params: IPostCustomAddRequest) =>
  defHttp.post({ url: `/system/auxiliary/custom/add`, params });
